package com.yonyou.cyxdms.basedata.service.entity.basedata;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;

/**
 * <p>
 * 基础数据
 * </p>
 *
 * @author dengqiang
 * @since 2019-11-21
 */
@TableName("tm_basedata")
public class BasedataPO extends DMSBasePO<BasedataPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 基础数据ID
     */
    @TableId(value = "BASEDATA_ID", type = IdType.AUTO)
    private Long basedataId;

    /**
     * APP_ID
     */
    @TableField("APP_ID")
    private String appId;

    /**
     * 公司代码
     */
    @TableField("COMPANY_CODE")
    private String companyCode;
    /**
     * 经销商代码
     */
    @TableField("OWNER_CODE")
    private String ownerCode;
    /**
     * 所有者的父组织代码（用于二网使用）
     */
    @TableField("OWNER_PAR_CODE")
    private String ownerParCode;
    /**
     * 基础数据标识
     */
    @TableField("BASEDATA_TYPE")
    private String basedataType;
    /**
     * 基础数据名称
     */
    @TableField("BASEDATA_NAME")
    private String basedataName;
    /**
     * 数据来源
     */
    @TableField("DATA_SOURCES")
    private Integer dataSources;
    /**
     * 是否有效
     */
    @TableField("IS_VALID")
    private Integer isValid;
    /**
     * 是否删除(0:未删除1:删除)
     */
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public BasedataPO() {
        super();
    }


    public Long getBasedataId() {
        return basedataId;
    }

    public void setBasedataId(Long basedataId) {
        this.basedataId = basedataId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public String getOwnerParCode() {
        return ownerParCode;
    }

    public void setOwnerParCode(String ownerParCode) {
        this.ownerParCode = ownerParCode;
    }

    public String getBasedataType() {
        return basedataType;
    }

    public void setBasedataType(String basedataType) {
        this.basedataType = basedataType;
    }

    public String getBasedataName() {
        return basedataName;
    }

    public void setBasedataName(String basedataName) {
        this.basedataName = basedataName;
    }

    public Integer getDataSources() {
        return dataSources;
    }

    public void setDataSources(Integer dataSources) {
        this.dataSources = dataSources;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.basedataId;
    }

    @Override
    public String toString() {
        return "BasedataPO{" +
                "basedataId=" + basedataId +
                ", appId=" + appId +
                ", companyCode=" + companyCode +
                ", ownerCode=" + ownerCode +
                ", ownerParCode=" + ownerParCode +
                ", basedataType=" + basedataType +
                ", basedataName=" + basedataName +
                ", dataSources=" + dataSources +
                ", isValid=" + isValid +
                ", isDeleted=" + isDeleted +
                "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author dengqiang
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "basedataId");
    }


}
